<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - qgetopt test coverage - object/optionManager/optManager.cpp</title>
  <link rel="stylesheet" type="text/css" href="../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../index.html">directory</a> - <a href="index.html">object/optionManager</a> - optManager.cpp</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>qgetopt test coverage</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2009-08-26</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">215</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">97.7 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">210</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : /*! \ingroup qgetopt
<span class="lineNum">       2 </span>                :  * \class OptManager
<span class="lineNum">       3 </span>                :  * \attention This program is free software; you can redistribute it and/or modify
<span class="lineNum">       4 </span>                :  * it under the terms of the GNU General Public License as published by
<span class="lineNum">       5 </span>                :  * the Free Software Foundation; either version 2 of the License, or
<span class="lineNum">       6 </span>                :  * (at your option) any later version.
<span class="lineNum">       7 </span>                :  *
<span class="lineNum">       8 </span>                :  * \attention This program is distributed in the hope that it will be useful,
<span class="lineNum">       9 </span>                :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      10 </span>                :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
<span class="lineNum">      11 </span>                :  * GNU General Public License for more details.
<span class="lineNum">      12 </span>                :  *
<span class="lineNum">      13 </span>                :  * \attention You should have received a copy of the GNU General Public License
<span class="lineNum">      14 </span>                :  * along with this program; if not, write to the
<span class="lineNum">      15 </span>                :  * Free Software Foundation, Inc.,
<span class="lineNum">      16 </span>                :  * 59 Temple Place - Suite 330, Boston, MA  02111-1307  USA
<span class="lineNum">      17 </span>                :  *
<span class="lineNum">      18 </span>                :    \author    Graeme
<span class="lineNum">      19 </span>                :    \date Copyright (C) 2008-9  Graeme Foster
<span class="lineNum">      20 </span>                :  */
<span class="lineNum">      21 </span>                : #include &quot;optManager.h&quot;
<span class="lineNum">      22 </span>                : /*! \ingroup qgetopt
<span class="lineNum">      23 </span>                :     \internal
<span class="lineNum">      24 </span>                : */
<span class="lineNum">      25 </span>                : OptManager * OptManager::_instancePtr=0;
<span class="lineNum">      26 </span>                : 
<span class="lineNum">      27 </span>                : 
<span class="lineNum">      28 </span>                : /*****************************************************************************/
<span class="lineNum">      29 </span>                : /* Public Methods
<span class="lineNum">      30 </span>                :  *****************************************************************************/
<span class="lineNum">      31 </span>                : /*! This method will locate the switch specified by \em opt and then return the
<span class="lineNum">      32 </span>                :     list of arguments associate with the switch.
<span class="lineNum">      33 </span>                :     If the switch hasn't been used then the method will return an empty list
<span class="lineNum">      34 </span>                :  */
<span class="lineNum">      35 </span><span class="lineCov">              2 : QStringList OptManager::getSwitchDetails(QString opt)</span>
<span class="lineNum">      36 </span>                : {
<span class="lineNum">      37 </span><span class="lineCov">              2 :    for (int i = 0; i &lt; _activeSwitches.size(); ++i)</span>
<span class="lineNum">      38 </span>                :    {
<span class="lineNum">      39 </span><span class="lineCov">              1 :       if (_activeSwitches[i]-&gt;name() == opt)</span>
<span class="lineNum">      40 </span><span class="lineCov">              1 :          return _activeSwitches[i]-&gt;argList();</span>
<span class="lineNum">      41 </span>                :    }
<span class="lineNum">      42 </span><span class="lineCov">              1 :    return QStringList();</span>
<span class="lineNum">      43 </span>                : }
<span class="lineNum">      44 </span>                : 
<span class="lineNum">      45 </span>                : /*! This method will add an argument described by \em args to the application.
<span class="lineNum">      46 </span>                :     This argument must be supplied when the program runs.
<span class="lineNum">      47 </span>                :  */
<span class="lineNum">      48 </span><span class="lineCov">             26 : void OptManager::addAppArgs (QString args)</span>
<span class="lineNum">      49 </span>                : {
<span class="lineNum">      50 </span><span class="lineCov">             26 :    QStringList argParts = args.split(&quot; &quot;, QString::SkipEmptyParts);</span>
<span class="lineNum">      51 </span><span class="lineCov">             52 :    for (int i = 0; i &lt; argParts.size(); ++i)</span>
<span class="lineNum">      52 </span>                :    {
<span class="lineNum">      53 </span><span class="lineCov">             27 :       OptArgument * oa = new OptArgument(argParts[i]);</span>
<span class="lineNum">      54 </span><span class="lineCov">             27 :       if (oa-&gt;isOptional())</span>
<span class="lineNum">      55 </span><span class="lineCov">              1 :          throw QObject::tr(&quot;Program arguments cannot be optional&quot;);</span>
<span class="lineNum">      56 </span><span class="lineCov">             26 :       _argList.append(oa);</span>
<span class="lineNum">      57 </span><span class="lineCov">             26 :    }</span>
<span class="lineNum">      58 </span><span class="lineCov">             25 : }</span>
<span class="lineNum">      59 </span>                : 
<span class="lineNum">      60 </span>                : /*! This method will add a long switch to the program with the name of \em longName
<span class="lineNum">      61 </span>                :     and may optionally have a short switch of \em abbrev.
<span class="lineNum">      62 </span>                : 
<span class="lineNum">      63 </span>                :     If the switch is provided when the program is run
<span class="lineNum">      64 </span>                :     then the method \em act will be run at the start of the program,
<span class="lineNum">      65 </span>                :     it is actually run within the parse() method. Additionally, if provided, the \em exit method
<span class="lineNum">      66 </span>                :     will be run when the program completes, this is done from within the close() method.
<span class="lineNum">      67 </span>                : 
<span class="lineNum">      68 </span>                :     The optional parameter \em conclude determines whether the switch will stop the program once
<span class="lineNum">      69 </span>                :     its method has been performed. By default the \em --help switch is a conclude switch,
<span class="lineNum">      70 </span>                :     so it displays the help screen and then the program will stop.
<span class="lineNum">      71 </span>                :  */
<span class="lineNum">      72 </span><span class="lineCov">            115 : OptSwitch * OptManager::addSwitch(QString longName</span>
<span class="lineNum">      73 </span>                :                                  ,ActionFuncPtr actionMethod
<span class="lineNum">      74 </span>                :                                  ,QChar abbrev
<span class="lineNum">      75 </span>                :                                  ,QString args
<span class="lineNum">      76 </span>                :                                  ,CloseFuncPtr exitMethod
<span class="lineNum">      77 </span>                :                                  ,switchStyle style
<span class="lineNum">      78 </span>                :                                  )
<span class="lineNum">      79 </span>                : {
<span class="lineNum">      80 </span><span class="lineCov">            115 :    if (!uniqueAbbrev(abbrev))</span>
<span class="lineNum">      81 </span><span class="lineCov">              1 :       throw QString(&quot;Duplicate switch -&quot;)+abbrev+&quot; used.&quot;;</span>
<span class="lineNum">      82 </span><span class="lineCov">            114 :    OptSwitch * sw = new OptSwitch(abbrev, longName, args, actionMethod, exitMethod, style);</span>
<span class="lineNum">      83 </span><span class="lineCov">            114 :    _switchList.append(sw);</span>
<span class="lineNum">      84 </span><span class="lineCov">            114 :    return sw;</span>
<span class="lineNum">      85 </span>                : }
<span class="lineNum">      86 </span>                : 
<span class="lineNum">      87 </span>                : /*! This method will extract details from the commandline arguments passed in.
<span class="lineNum">      88 </span>                :     It expects the first element of argv to be the name of the application.
<span class="lineNum">      89 </span>                :     All subsequent elements of argv will either be a switch or argument.
<span class="lineNum">      90 </span>                :  */
<span class="lineNum">      91 </span><span class="lineCov">             23 : QString OptManager::parse(int argc, char *argv[], bool quiet)</span>
<span class="lineNum">      92 </span>                : {
<span class="lineNum">      93 </span><span class="lineCov">             23 :    QStringList argQueue;</span>
<span class="lineNum">      94 </span><span class="lineCov">             23 :    OptSwitch * sw = 0;</span>
<span class="lineNum">      95 </span><span class="lineCov">             84 :    for (int i =1; i &lt; argc; ++i)</span>
<span class="lineNum">      96 </span>                :    {
<span class="lineNum">      97 </span><span class="lineCov">             61 :       if (isSwitch(argv[i]))</span>
<span class="lineNum">      98 </span>                :       {
<span class="lineNum">      99 </span><span class="lineCov">             24 :          if (!parseArgument(sw, argQueue, true))</span>
<span class="lineNum">     100 </span><span class="lineCov">              1 :             _activeSwitches.removeLast(); // remove last switch because there is an argument error</span>
<span class="lineNum">     101 </span><span class="lineCov">             24 :          sw = parseSwitch(argv[i]);</span>
<span class="lineNum">     102 </span>                :       }
<span class="lineNum">     103 </span>                :       else
<span class="lineNum">     104 </span>                :       {
<span class="lineNum">     105 </span><span class="lineCov">             37 :          argQueue.push_back(argv[i]);</span>
<span class="lineNum">     106 </span>                :       }
<span class="lineNum">     107 </span>                :    } // end of looping through each argument that was passed in.
<span class="lineNum">     108 </span><span class="lineCov">             23 :    if (!parseArgument(sw, argQueue, false))</span>
<span class="lineNum">     109 </span><span class="lineCov">              4 :       _activeSwitches.removeLast(); // remove last switch because there is an argument error</span>
<span class="lineNum">     110 </span>                :    // Ready to run the code that is triggered by the switches.
<span class="lineNum">     111 </span><span class="lineCov">             23 :    execute();</span>
<span class="lineNum">     112 </span>                : 
<span class="lineNum">     113 </span><span class="lineCov">             19 :    QString notices;</span>
<span class="lineNum">     114 </span><span class="lineCov">             19 :    notices = getWarnings() + getErrors();</span>
<span class="lineNum">     115 </span><span class="lineCov">             19 :    if (!quiet)</span>
<span class="lineNum">     116 </span>                :    {
<span class="lineNum">     117 </span><span class="lineCov">             18 :       QTextStream console(stdout);</span>
<span class="lineNum">     118 </span><span class="lineCov">             18 :       console &lt;&lt; notices;</span>
<span class="lineNum">     119 </span><span class="lineCov">             18 :       console.flush();</span>
<span class="lineNum">     120 </span><span class="lineCov">             18 :       if (_error.size() &gt; 0)</span>
<span class="lineNum">     121 </span><span class="lineCov">              7 :          exit (-1);</span>
<span class="lineNum">     122 </span>                :    }
<span class="lineNum">     123 </span><span class="lineCov">             12 :    return notices;</span>
<span class="lineNum">     124 </span>                : }
<span class="lineNum">     125 </span>                : 
<span class="lineNum">     126 </span>                : /*! This method will ensure that all closing methods (if any) are called. For example a switch
<span class="lineNum">     127 </span>                :     that automates logging to a file may require an exit method to close the file, this method
<span class="lineNum">     128 </span>                :     can be setup as the \em exit parameter of the addSwitch() method.
<span class="lineNum">     129 </span>                :  */
<span class="lineNum">     130 </span><span class="lineCov">              8 : void OptManager::close()</span>
<span class="lineNum">     131 </span>                : {
<span class="lineNum">     132 </span><span class="lineCov">             18 :    for (int i = 0; i&lt; _activeSwitches.size(); ++i)</span>
<span class="lineNum">     133 </span><span class="lineCov">             10 :       _activeSwitches[i]-&gt;close();</span>
<span class="lineNum">     134 </span><span class="lineCov">              8 : }</span>
<span class="lineNum">     135 </span>                : 
<span class="lineNum">     136 </span>                : /*! This method will return all the error messaegs in a single string each separated by a newline */
<span class="lineNum">     137 </span><span class="lineCov">             19 : QString OptManager::getErrors()</span>
<span class="lineNum">     138 </span>                : {
<span class="lineNum">     139 </span><span class="lineCov">             19 :    QString errors;</span>
<span class="lineNum">     140 </span><span class="lineCov">             27 :    for (int i = 0; i &lt; _error.size(); ++i)</span>
<span class="lineNum">     141 </span><span class="lineCov">              8 :       errors += &quot;Error: &quot; + _error[i] + &quot;\n&quot;;</span>
<span class="lineNum">     142 </span><span class="lineNoCov">              0 :    return errors;</span>
<span class="lineNum">     143 </span>                : }
<span class="lineNum">     144 </span>                : 
<span class="lineNum">     145 </span>                : /*! This method will return all the warning messaegs in a single string each separated by a newline */
<span class="lineNum">     146 </span><span class="lineCov">             19 : QString OptManager::getWarnings()</span>
<span class="lineNum">     147 </span>                : {
<span class="lineNum">     148 </span><span class="lineCov">             19 :    QString warnings;</span>
<span class="lineNum">     149 </span><span class="lineCov">             21 :    for (int i = 0; i&lt; _warning.size(); ++i)</span>
<span class="lineNum">     150 </span><span class="lineCov">              2 :       warnings += &quot;Warning: &quot; + _warning[i] + &quot;\n&quot;;</span>
<span class="lineNum">     151 </span><span class="lineNoCov">              0 :    return warnings;</span>
<span class="lineNum">     152 </span>                : }
<span class="lineNum">     153 </span>                : 
<span class="lineNum">     154 </span>                : /*! This method will return a description of the selected switch */
<span class="lineNum">     155 </span><span class="lineCov">              5 : QString OptManager::switchDumpTemplate(int i)</span>
<span class="lineNum">     156 </span>                : {
<span class="lineNum">     157 </span><span class="lineCov">              5 :    return ((i&gt;=0) &amp;&amp; (i&lt;_switchList.size()))? _switchList[i]-&gt;help():&quot;&quot;;</span>
<span class="lineNum">     158 </span>                : }
<span class="lineNum">     159 </span>                : 
<span class="lineNum">     160 </span>                : /*! This method will return as a QString the details of each switch that has been selected by the user.
<span class="lineNum">     161 </span>                :     It will display the detail one switch per line.
<span class="lineNum">     162 </span>                :  */
<span class="lineNum">     163 </span><span class="lineCov">              5 : QString OptManager::switchDump()</span>
<span class="lineNum">     164 </span>                : {
<span class="lineNum">     165 </span><span class="lineCov">              5 :    QString details;</span>
<span class="lineNum">     166 </span><span class="lineCov">             12 :    for (int i = 0; i &lt; _activeSwitches.size(); ++i)</span>
<span class="lineNum">     167 </span>                :    {
<span class="lineNum">     168 </span><span class="lineCov">              7 :       details += &quot;   &quot; + _activeSwitches[i]-&gt;dump() + &quot;\n&quot;;</span>
<span class="lineNum">     169 </span>                :    }
<span class="lineNum">     170 </span><span class="lineNoCov">              0 :    return details;</span>
<span class="lineNum">     171 </span>                : }
<span class="lineNum">     172 </span>                : 
<span class="lineNum">     173 </span>                : /*! This method will return as a QString a list of each argument that been provided by the user
<span class="lineNum">     174 </span>                :     specifically for the application. It will display the arguments seperated by a space.
<span class="lineNum">     175 </span>                :  */
<span class="lineNum">     176 </span><span class="lineCov">              6 : QString OptManager::appArgDump()</span>
<span class="lineNum">     177 </span>                : {
<span class="lineNum">     178 </span><span class="lineCov">              6 :    QString details;</span>
<span class="lineNum">     179 </span><span class="lineCov">             12 :    for (int i = 0; i &lt; _actualAppArgList.size(); ++i)</span>
<span class="lineNum">     180 </span>                :    {
<span class="lineNum">     181 </span><span class="lineCov">              6 :       details +=  &quot; &quot; + _actualAppArgList[i];</span>
<span class="lineNum">     182 </span>                :    }
<span class="lineNum">     183 </span><span class="lineNoCov">              0 :    return details;</span>
<span class="lineNum">     184 </span>                : }
<span class="lineNum">     185 </span>                : 
<span class="lineNum">     186 </span>                : 
<span class="lineNum">     187 </span>                : /*****************************************************************************/
<span class="lineNum">     188 </span>                : /* Private Methods
<span class="lineNum">     189 </span>                :  *****************************************************************************/
<span class="lineNum">     190 </span>                : 
<span class="lineNum">     191 </span>                : /*! \internal This will instantiate an instance of the OptManager class.
<span class="lineNum">     192 </span>                :   * By default it adds a single switch the --help switch that
<span class="lineNum">     193 </span>                :   * is used to automatically display information about the program
<span class="lineNum">     194 </span>                :   */
<span class="lineNum">     195 </span><span class="lineCov">             24 : OptManager::OptManager(QFileInfo appFullName)</span>
<span class="lineNum">     196 </span>                : {
<span class="lineNum">     197 </span><span class="lineCov">             24 :    _appName = appFullName.baseName();</span>
<span class="lineNum">     198 </span><span class="lineCov">             24 :    _path    = appFullName.path();</span>
<span class="lineNum">     199 </span><span class="lineCov">             24 :    _initMethodPtr = 0;</span>
<span class="lineNum">     200 </span><span class="lineCov">             24 :    _cmdLine = &quot;&quot;;</span>
<span class="lineNum">     201 </span><span class="lineCov">             24 :    _error.clear();</span>
<span class="lineNum">     202 </span><span class="lineCov">             24 :    QString detail;</span>
<span class="lineNum">     203 </span><span class="lineCov">             24 :    detail = QObject::tr(&quot;Display this information&quot;);</span>
<span class="lineNum">     204 </span><span class="lineCov">             24 :    addSwitch(&quot;help&quot;, help, 'h',&quot;&quot;,0,immediateStop)-&gt;addDescription(detail);</span>
<span class="lineNum">     205 </span><span class="lineCov">             24 : }</span>
<span class="lineNum">     206 </span>                : 
<span class="lineNum">     207 </span>                : /*! This class is a singleton class and so the constructor is private, because of that an object
<span class="lineNum">     208 </span>                :     cannot be created via new instead it will be returned by this method.
<span class="lineNum">     209 </span>                : 
<span class="lineNum">     210 </span>                :     The first time that this method is called the \em appFullName needs to be provided
<span class="lineNum">     211 </span>                :     for all subsequent calls it is not needed because the instance will just be returned.
<span class="lineNum">     212 </span>                :  */
<span class="lineNum">     213 </span><span class="lineCov">             45 : OptManager * OptManager::getOptMgr(QString appFullName)</span>
<span class="lineNum">     214 </span>                : {
<span class="lineNum">     215 </span><span class="lineCov">             45 :    if (_instancePtr==0)</span>
<span class="lineNum">     216 </span><span class="lineCov">             24 :       _instancePtr = new OptManager(appFullName);</span>
<span class="lineNum">     217 </span><span class="lineCov">             45 :    return _instancePtr;</span>
<span class="lineNum">     218 </span>                : }
<span class="lineNum">     219 </span>                : 
<span class="lineNum">     220 </span>                : 
<span class="lineNum">     221 </span>                : /*! \internal This will first look for an then execute any method of a conclude switch
<span class="lineNum">     222 </span>                :     If there was a conclude switch then control will be returned to the calling method
<span class="lineNum">     223 </span>                :     Assuming that there was nine then the application init method is run followed by
<span class="lineNum">     224 </span>                :     the execute method of each switch.
<span class="lineNum">     225 </span>                :  */
<span class="lineNum">     226 </span><span class="lineCov">             23 : void OptManager::execute()</span>
<span class="lineNum">     227 </span>                : {
<span class="lineNum">     228 </span><span class="lineCov">             36 :    for (int i = 0; i&lt; _activeSwitches.size(); ++i)</span>
<span class="lineNum">     229 </span>                :    {
<span class="lineNum">     230 </span><span class="lineCov">             17 :       if (_activeSwitches[i]-&gt;finishProcessing())</span>
<span class="lineNum">     231 </span>                :       {
<span class="lineNum">     232 </span><span class="lineCov">              4 :          _activeSwitches[i]-&gt;execute();</span>
<span class="lineNum">     233 </span><span class="lineCov">              4 :          _activeSwitches[i]-&gt;close();</span>
<span class="lineNum">     234 </span><span class="lineCov">              4 :          exit(0);</span>
<span class="lineNum">     235 </span>                :       }
<span class="lineNum">     236 </span>                :    }
<span class="lineNum">     237 </span><span class="lineCov">             19 :    if (_error.size() == 0)</span>
<span class="lineNum">     238 </span>                :    {
<span class="lineNum">     239 </span><span class="lineCov">             11 :       if (_initMethodPtr)</span>
<span class="lineNum">     240 </span><span class="lineCov">              1 :          _initMethodPtr(_actualAppArgList);</span>
<span class="lineNum">     241 </span><span class="lineCov">             22 :       for (int i = 0; i&lt; _activeSwitches.size(); ++i)</span>
<span class="lineNum">     242 </span>                :       {
<span class="lineNum">     243 </span><span class="lineCov">             11 :          _activeSwitches[i]-&gt;execute();</span>
<span class="lineNum">     244 </span>                :       }
<span class="lineNum">     245 </span>                :    }
<span class="lineNum">     246 </span><span class="lineCov">             19 : }</span>
<span class="lineNum">     247 </span>                : 
<span class="lineNum">     248 </span>                : /*! \internal Uses the private methods isNumber(), isLongSwitch() and isShortSwitch() to
<span class="lineNum">     249 </span>                :     determine if the parampassed in is a switch. It will first call isNumber() and return
<span class="lineNum">     250 </span>                :     false if true is returned this is necessary to allow a negative number to be passed in as
<span class="lineNum">     251 </span>                :     an argument.
<span class="lineNum">     252 </span>                :  */
<span class="lineNum">     253 </span><span class="lineCov">             61 : bool OptManager::isSwitch(QString param)</span>
<span class="lineNum">     254 </span>                : {
<span class="lineNum">     255 </span><span class="lineCov">             61 :    if (isNumber(param))</span>
<span class="lineNum">     256 </span><span class="lineCov">             18 :       return false;</span>
<span class="lineNum">     257 </span><span class="lineCov">             43 :    return (isLongSwitch(param) || isShortSwitch(param));</span>
<span class="lineNum">     258 </span>                : }
<span class="lineNum">     259 </span>                : 
<span class="lineNum">     260 </span>                : /*!
<span class="lineNum">     261 </span>                :     \internal This is used by isSwitch() to see if \em param is a short switch.
<span class="lineNum">     262 </span>                :  */
<span class="lineNum">     263 </span><span class="lineCov">             55 : bool OptManager::isShortSwitch(QString param)</span>
<span class="lineNum">     264 </span>                : {
<span class="lineNum">     265 </span><span class="lineCov">             55 :    return (!isLongSwitch(param) &amp;&amp; param.startsWith(&quot;-&quot;));</span>
<span class="lineNum">     266 </span>                : }
<span class="lineNum">     267 </span>                : 
<span class="lineNum">     268 </span>                : /*!
<span class="lineNum">     269 </span>                :     \internal This is used by isSwitch() to see if \em param is a long switch.
<span class="lineNum">     270 </span>                :  */
<span class="lineNum">     271 </span><span class="lineCov">            110 : bool OptManager::isLongSwitch(QString param)</span>
<span class="lineNum">     272 </span>                : {
<span class="lineNum">     273 </span><span class="lineCov">            110 :    return param.startsWith(&quot;--&quot;);</span>
<span class="lineNum">     274 </span>                : }
<span class="lineNum">     275 </span>                : 
<span class="lineNum">     276 </span>                : /*!
<span class="lineNum">     277 </span>                :     \internal This is used by isSwitch() to see if \em param is a number.
<span class="lineNum">     278 </span>                :     If the option is a valid number then it will be treated as an argument
<span class="lineNum">     279 </span>                :     and not a switch. This is neccessary to allow for arguments of negative numbers.
<span class="lineNum">     280 </span>                :  */
<span class="lineNum">     281 </span><span class="lineCov">             61 : bool OptManager::isNumber(QString param)</span>
<span class="lineNum">     282 </span>                : {
<span class="lineNum">     283 </span><span class="lineCov">             61 :    int decimalCnt = 0;</span>
<span class="lineNum">     284 </span><span class="lineCov">            114 :    for(int i = 0; i&lt;param.length(); ++i)</span>
<span class="lineNum">     285 </span>                :    {
<span class="lineNum">     286 </span><span class="lineCov">             96 :       if (param[i].isNumber())</span>
<span class="lineNum">     287 </span><span class="lineCov">             28 :          continue;</span>
<span class="lineNum">     288 </span><span class="lineCov">             68 :       if (i == 0 &amp;&amp; param[i]=='-')</span>
<span class="lineNum">     289 </span><span class="lineCov">             24 :          continue;</span>
<span class="lineNum">     290 </span><span class="lineCov">             44 :       if (param[i] == '.' &amp;&amp; decimalCnt == 0)</span>
<span class="lineNum">     291 </span>                :       {
<span class="lineNum">     292 </span><span class="lineCov">              1 :          decimalCnt = 1;</span>
<span class="lineNum">     293 </span><span class="lineCov">              1 :          continue;</span>
<span class="lineNum">     294 </span>                :       }
<span class="lineNum">     295 </span><span class="lineCov">             43 :       return false;</span>
<span class="lineNum">     296 </span>                :    }
<span class="lineNum">     297 </span><span class="lineCov">             18 :    return true;</span>
<span class="lineNum">     298 </span>                : }
<span class="lineNum">     299 </span>                : 
<span class="lineNum">     300 </span>                : /*! This method will return true if the character passed in is null
<span class="lineNum">     301 </span>                :     or if has not yet been used as a short switch.
<span class="lineNum">     302 </span>                :     Otherwise it will return false.
<span class="lineNum">     303 </span>                :  */
<span class="lineNum">     304 </span><span class="lineCov">            115 : bool OptManager::uniqueAbbrev(QChar abbrev)</span>
<span class="lineNum">     305 </span>                : {
<span class="lineNum">     306 </span><span class="lineCov">            115 :    if (abbrev.isNull())</span>
<span class="lineNum">     307 </span><span class="lineCov">              1 :       return true;</span>
<span class="lineNum">     308 </span><span class="lineCov">            342 :    for (int i =0; i &lt; _switchList.size(); ++i)</span>
<span class="lineNum">     309 </span>                :    {
<span class="lineNum">     310 </span><span class="lineCov">            229 :       if (_switchList[i]-&gt;abbrev() == abbrev)</span>
<span class="lineNum">     311 </span><span class="lineCov">              1 :          return false;</span>
<span class="lineNum">     312 </span>                :    }
<span class="lineNum">     313 </span><span class="lineCov">            113 :    return true;</span>
<span class="lineNum">     314 </span>                : }
<span class="lineNum">     315 </span>                : 
<span class="lineNum">     316 </span>                : /*!
<span class="lineNum">     317 </span>                :     \internal This receives a QStringList \em argQueue of arguments which will be assigned to either the
<span class="lineNum">     318 </span>                :     program or the switch \em sw that is passed in. If \em more is set to true then there are
<span class="lineNum">     319 </span>                :     more switches waiting to be processed and so all the arguments should belong to a switch.
<span class="lineNum">     320 </span>                :     Otherwise the program arguments will be processed first followed by the switch arguments.
<span class="lineNum">     321 </span>                : 
<span class="lineNum">     322 </span>                :     If there is an error condition then the error message will be placed on the \em error member variable.
<span class="lineNum">     323 </span>                : 
<span class="lineNum">     324 </span>                :     If the arguments for the switch are in error then false will be returned otherwise true is returned
<span class="lineNum">     325 </span>                :     (even if there is an error condition).
<span class="lineNum">     326 </span>                :     The reason for this is that if the switch is in error then it will be removed and processing will continue
<span class="lineNum">     327 </span>                :     to allow for the &quot;discovery&quot; of a valid conclude switch, such as --help. This means that even if the other
<span class="lineNum">     328 </span>                :     switches are in error the help screen will be displayed.
<span class="lineNum">     329 </span>                :  */
<span class="lineNum">     330 </span><span class="lineCov">             51 : bool OptManager::parseArgument(OptSwitch * sw, QStringList &amp;argQueue, bool more)</span>
<span class="lineNum">     331 </span>                : {
<span class="lineNum">     332 </span>                :    // This method returns false if a switch's arguments are in error. For other errors true is returned.
<span class="lineNum">     333 </span><span class="lineCov">             51 :    if (!more)</span>
<span class="lineNum">     334 </span>                :    {
<span class="lineNum">     335 </span>                :       // If there is a completer switch then grab the arguments and return
<span class="lineNum">     336 </span><span class="lineCov">             23 :       if(sw != 0 &amp;&amp; sw-&gt;finishProcessing())</span>
<span class="lineNum">     337 </span>                :       {
<span class="lineNum">     338 </span><span class="lineCov">              5 :          return parseSwitchArgument(sw,argQueue);</span>
<span class="lineNum">     339 </span>                :       }
<span class="lineNum">     340 </span>                :       // Remove the program arguments before sorting out any arguments for the switch
<span class="lineNum">     341 </span><span class="lineCov">             18 :       if (_argList.size() &gt; argQueue.size())</span>
<span class="lineNum">     342 </span>                :       {
<span class="lineNum">     343 </span>                :          _error.append(QObject::tr(&quot;Insufficient program arguments. %1 expected %2 provided.&quot;)
<span class="lineNum">     344 </span>                :                      .arg(_argList.size())
<span class="lineNum">     345 </span>                :                      .arg(argQueue.size())
<span class="lineNum">     346 </span><span class="lineCov">              1 :                      );</span>
<span class="lineNum">     347 </span><span class="lineCov">              1 :          argQueue.clear();</span>
<span class="lineNum">     348 </span><span class="lineCov">              1 :          return true;</span>
<span class="lineNum">     349 </span>                :       }
<span class="lineNum">     350 </span><span class="lineCov">             68 :       for (int i = 0; i &lt; _argList.size(); ++i)</span>
<span class="lineNum">     351 </span>                :       {
<span class="lineNum">     352 </span><span class="lineCov">             17 :          _actualAppArgList.prepend(argQueue.takeLast());</span>
<span class="lineNum">     353 </span>                :       }
<span class="lineNum">     354 </span>                :    } // end of if there are no more switches to be processed
<span class="lineNum">     355 </span><span class="lineCov">             45 :    if (sw == 0)</span>
<span class="lineNum">     356 </span>                :    {
<span class="lineNum">     357 </span><span class="lineCov">             24 :       if (argQueue.size() &gt; 0)</span>
<span class="lineNum">     358 </span>                :       {
<span class="lineNum">     359 </span>                :          _error.append(QObject::tr(&quot;No switch defined for the argument %1.&quot;)
<span class="lineNum">     360 </span>                :                      .arg(argQueue[0])
<span class="lineNum">     361 </span><span class="lineCov">              1 :                      );</span>
<span class="lineNum">     362 </span><span class="lineCov">              1 :          argQueue.clear();</span>
<span class="lineNum">     363 </span>                :       }
<span class="lineNum">     364 </span><span class="lineCov">             24 :       return true;</span>
<span class="lineNum">     365 </span>                :    }
<span class="lineNum">     366 </span><span class="lineCov">             21 :    return parseSwitchArgument(sw,argQueue);</span>
<span class="lineNum">     367 </span>                : }
<span class="lineNum">     368 </span>                : 
<span class="lineNum">     369 </span>                : /*!
<span class="lineNum">     370 </span>                :     \internal This is used by parseArgument() to add the arguments held in \em argQueue to the switch \em sw.
<span class="lineNum">     371 </span>                : 
<span class="lineNum">     372 </span>                :     If there is an error condition then the error message will be placed on the \em error member variable.
<span class="lineNum">     373 </span>                : 
<span class="lineNum">     374 </span>                :     If the arguments for the switch are in error then false will be returned otherwise true is returned
<span class="lineNum">     375 </span>                :  */
<span class="lineNum">     376 </span><span class="lineCov">             26 : bool OptManager::parseSwitchArgument(OptSwitch * sw, QStringList &amp;argQueue)</span>
<span class="lineNum">     377 </span>                : {
<span class="lineNum">     378 </span><span class="lineCov">             26 :    if (argQueue.size() &gt; sw-&gt;argCnt())</span>
<span class="lineNum">     379 </span>                :    {
<span class="lineNum">     380 </span>                :       _error.append(QObject::tr(&quot;Too many arguments for the switch --%1. %2 expected %3 provided.&quot;)
<span class="lineNum">     381 </span>                :                   .arg(sw-&gt;name())
<span class="lineNum">     382 </span>                :                   .arg(sw-&gt;argCnt())
<span class="lineNum">     383 </span>                :                   .arg(argQueue.size())
<span class="lineNum">     384 </span><span class="lineCov">              2 :                   );</span>
<span class="lineNum">     385 </span><span class="lineCov">              2 :       argQueue.clear();</span>
<span class="lineNum">     386 </span><span class="lineCov">              2 :       return false;</span>
<span class="lineNum">     387 </span>                :    }
<span class="lineNum">     388 </span><span class="lineCov">             24 :    if (argQueue.size() &lt; sw-&gt;mArgCnt())</span>
<span class="lineNum">     389 </span>                :    {
<span class="lineNum">     390 </span>                :       _error.append(QObject::tr(&quot;Insufficient arguments for the switch --%1. %2 expected %3 provided.&quot;)
<span class="lineNum">     391 </span>                :                   .arg(sw-&gt;name())
<span class="lineNum">     392 </span>                :                   .arg(sw-&gt;mArgCnt())
<span class="lineNum">     393 </span>                :                   .arg(argQueue.size())
<span class="lineNum">     394 </span><span class="lineCov">              2 :                   );</span>
<span class="lineNum">     395 </span><span class="lineCov">              2 :       argQueue.clear();</span>
<span class="lineNum">     396 </span><span class="lineCov">              2 :       return false;</span>
<span class="lineNum">     397 </span>                :    }
<span class="lineNum">     398 </span><span class="lineCov">             22 :    if (sw-&gt;actualArgCnt()&gt;0)</span>
<span class="lineNum">     399 </span>                :    {
<span class="lineNum">     400 </span>                :       //This means that the switch has already been parsed with arguments
<span class="lineNum">     401 </span><span class="lineCov">              3 :       if (sw-&gt;actualArgCnt() != argQueue.size())</span>
<span class="lineNum">     402 </span>                :       {
<span class="lineNum">     403 </span>                :          _error.append(QObject::tr(&quot;The switch --%1 was duplicated with different arguments.&quot;)
<span class="lineNum">     404 </span>                :                      .arg(sw-&gt;name())
<span class="lineNum">     405 </span><span class="lineCov">              1 :                      );</span>
<span class="lineNum">     406 </span><span class="lineCov">              1 :          argQueue.clear();</span>
<span class="lineNum">     407 </span><span class="lineCov">              1 :          return false;</span>
<span class="lineNum">     408 </span>                :       }
<span class="lineNum">     409 </span><span class="lineCov">              3 :       for (int i = 0; i &lt; sw-&gt;actualArgCnt(); ++i)</span>
<span class="lineNum">     410 </span>                :       {
<span class="lineNum">     411 </span><span class="lineCov">              2 :          if (sw-&gt;getArg(i) != argQueue.at(i))</span>
<span class="lineNum">     412 </span>                :          {
<span class="lineNum">     413 </span>                :             _error.append(QObject::tr(&quot;The switch --%1 was duplicated with different arguments.&quot;)
<span class="lineNum">     414 </span>                :                         .arg(sw-&gt;name())
<span class="lineNum">     415 </span><span class="lineCov">              1 :                         );</span>
<span class="lineNum">     416 </span><span class="lineCov">              1 :             argQueue.clear();</span>
<span class="lineNum">     417 </span><span class="lineCov">              1 :             return false;</span>
<span class="lineNum">     418 </span>                :          }
<span class="lineNum">     419 </span>                :       }
<span class="lineNum">     420 </span>                :       // the Arguments are identical so just return
<span class="lineNum">     421 </span><span class="lineCov">              1 :       return true;</span>
<span class="lineNum">     422 </span>                :    }
<span class="lineNum">     423 </span><span class="lineCov">             50 :    while (!argQueue.isEmpty())</span>
<span class="lineNum">     424 </span>                :    {
<span class="lineNum">     425 </span><span class="lineCov">             12 :       sw-&gt;addActualArg(argQueue.takeFirst());</span>
<span class="lineNum">     426 </span>                :    }
<span class="lineNum">     427 </span><span class="lineCov">             19 :    return true;</span>
<span class="lineNum">     428 </span>                : }
<span class="lineNum">     429 </span>                : 
<span class="lineNum">     430 </span>                : /*!
<span class="lineNum">     431 </span>                :     \internal This is used by parse to create an instance of a switch from \em opt.
<span class="lineNum">     432 </span>                :     This method will use parseShortSwitchList() and parseLongSwitch() methods to create the instance.
<span class="lineNum">     433 </span>                :     It will check that \em opt is a valid switch before calling these helper methods.
<span class="lineNum">     434 </span>                :  */
<span class="lineNum">     435 </span><span class="lineCov">             24 : OptSwitch * OptManager::parseSwitch(QString opt)</span>
<span class="lineNum">     436 </span>                : {
<span class="lineNum">     437 </span><span class="lineCov">             24 :    if (isShortSwitch(opt))</span>
<span class="lineNum">     438 </span><span class="lineCov">             12 :       return parseShortSwitchList(opt);</span>
<span class="lineNum">     439 </span><span class="lineCov">             12 :    if (isLongSwitch(opt))</span>
<span class="lineNum">     440 </span><span class="lineCov">             12 :       return parseLongSwitch(opt);</span>
<span class="lineNum">     441 </span>                :    else // Should never get here because isSwitch() should always be called before this method
<span class="lineNum">     442 </span><span class="lineNoCov">              0 :       return 0;</span>
<span class="lineNum">     443 </span>                : }
<span class="lineNum">     444 </span>                : 
<span class="lineNum">     445 </span>                : /*!
<span class="lineNum">     446 </span>                :     \internal This is used by parseSwitch() to create the short switches from \em opt.
<span class="lineNum">     447 </span>                :     The method expects a list of valid short switches and it will use parseShortSwitch
<span class="lineNum">     448 </span>                :     for each character in the list. Each switch will be held in the activeSwitches member variable.
<span class="lineNum">     449 </span>                :     The instance of the last switch will be returned.
<span class="lineNum">     450 </span>                : 
<span class="lineNum">     451 </span>                :     The instance of the last short switch is returned so that any arguments that follow can be associated
<span class="lineNum">     452 </span>                :     with this OptSwitch object by the parseArgument() method.
<span class="lineNum">     453 </span>                :  */
<span class="lineNum">     454 </span><span class="lineCov">             12 : OptSwitch * OptManager::parseShortSwitchList(QString opt)</span>
<span class="lineNum">     455 </span>                : {
<span class="lineNum">     456 </span><span class="lineCov">             12 :    OptSwitch * sw=0;</span>
<span class="lineNum">     457 </span><span class="lineCov">             12 :    QStringList emptyArgList;</span>
<span class="lineNum">     458 </span><span class="lineCov">             28 :    for (int i =1; i&lt;opt.size(); ++i)</span>
<span class="lineNum">     459 </span>                :    {
<span class="lineNum">     460 </span><span class="lineCov">             16 :       sw = parseShortSwitch(opt.at(i));</span>
<span class="lineNum">     461 </span><span class="lineCov">             16 :       if (i &lt; opt.size()-1)</span>
<span class="lineNum">     462 </span><span class="lineCov">              4 :          if(!parseArgument(sw,emptyArgList,true))</span>
<span class="lineNum">     463 </span><span class="lineCov">              1 :             _activeSwitches.removeLast(); // remove last switch because there is an argument error</span>
<span class="lineNum">     464 </span>                :    }
<span class="lineNum">     465 </span><span class="lineCov">             12 :    return sw;</span>
<span class="lineNum">     466 </span>                : }
<span class="lineNum">     467 </span>                : 
<span class="lineNum">     468 </span>                : /*!
<span class="lineNum">     469 </span>                :     \internal This is used by parseShortSwitchList() which will pass in a single character, this will be checked
<span class="lineNum">     470 </span>                :     against the list of known short switches and if it exists then an instance will be created and
<span class="lineNum">     471 </span>                :     added to the activeSwitches member variable. The instance will be returned.
<span class="lineNum">     472 </span>                : 
<span class="lineNum">     473 </span>                :     All switches that have been set up except the last will be verified that they don't require
<span class="lineNum">     474 </span>                :     arguments by calling parseArgument().
<span class="lineNum">     475 </span>                :     If they do require an argument then the error message will be set and the switch removed from the list.
<span class="lineNum">     476 </span>                :  */
<span class="lineNum">     477 </span><span class="lineCov">             16 : OptSwitch * OptManager::parseShortSwitch(QChar opt)</span>
<span class="lineNum">     478 </span>                : {
<span class="lineNum">     479 </span><span class="lineCov">             16 :    QListIterator &lt;OptSwitch *&gt; i(_switchList);</span>
<span class="lineNum">     480 </span><span class="lineCov">             16 :    while (i.hasNext())</span>
<span class="lineNum">     481 </span>                :    {
<span class="lineNum">     482 </span><span class="lineCov">             45 :       OptSwitch * sw = i.next();</span>
<span class="lineNum">     483 </span><span class="lineCov">             45 :       QString abbr = sw-&gt;abbrev();</span>
<span class="lineNum">     484 </span><span class="lineCov">             45 :       if (abbr == opt)</span>
<span class="lineNum">     485 </span>                :       {
<span class="lineNum">     486 </span><span class="lineCov">             15 :          if (!_activeSwitches.contains(sw))</span>
<span class="lineNum">     487 </span><span class="lineCov">             12 :             _activeSwitches.append(sw);</span>
<span class="lineNum">     488 </span><span class="lineCov">             15 :          return sw;</span>
<span class="lineNum">     489 </span>                :       }
<span class="lineNum">     490 </span>                :    }
<span class="lineNum">     491 </span><span class="lineCov">              1 :    _warning.append(QObject::tr(&quot;Unknown switch %1&quot;).arg(opt));</span>
<span class="lineNum">     492 </span><span class="lineCov">              1 :    return 0;</span>
<span class="lineNum">     493 </span>                : }
<span class="lineNum">     494 </span>                : 
<span class="lineNum">     495 </span>                : /*!
<span class="lineNum">     496 </span>                :     \internal This is used by parseSwitch() which will pass in a potental long switch, this will be checked
<span class="lineNum">     497 </span>                :     against the list of known switches and if it exists then an instance will be created and
<span class="lineNum">     498 </span>                :     added to the activeSwitches member variable. The instance will be returned.
<span class="lineNum">     499 </span>                :  */
<span class="lineNum">     500 </span><span class="lineCov">             12 : OptSwitch * OptManager::parseLongSwitch(QString opt)</span>
<span class="lineNum">     501 </span>                : {
<span class="lineNum">     502 </span><span class="lineCov">             12 :    opt.remove(0,2);</span>
<span class="lineNum">     503 </span><span class="lineCov">             12 :    QListIterator &lt;OptSwitch *&gt; i(_switchList);</span>
<span class="lineNum">     504 </span><span class="lineCov">             12 :    while (i.hasNext())</span>
<span class="lineNum">     505 </span>                :    {
<span class="lineNum">     506 </span><span class="lineCov">             29 :       OptSwitch * sw = i.next();</span>
<span class="lineNum">     507 </span><span class="lineCov">             29 :       QString option = sw-&gt;name();</span>
<span class="lineNum">     508 </span><span class="lineCov">             29 :       if (option == opt)</span>
<span class="lineNum">     509 </span>                :       {
<span class="lineNum">     510 </span><span class="lineCov">             11 :          if (!_activeSwitches.contains(sw))</span>
<span class="lineNum">     511 </span><span class="lineCov">             11 :             _activeSwitches.append(sw);</span>
<span class="lineNum">     512 </span><span class="lineCov">             11 :          return sw;</span>
<span class="lineNum">     513 </span>                :       }
<span class="lineNum">     514 </span>                :    }
<span class="lineNum">     515 </span><span class="lineCov">              1 :    _warning.append(QObject::tr(&quot;Unknown switch %1&quot;).arg(opt));</span>
<span class="lineNum">     516 </span><span class="lineCov">              1 :    return 0;</span>
<span class="lineNum">     517 </span>                : }
<span class="lineNum">     518 </span>                : 
<span class="lineNum">     519 </span>                : /*!
<span class="lineNum">     520 </span>                :     \internal This is used by the static method help() and does all the necessary formatting.
<span class="lineNum">     521 </span>                :  */
<span class="lineNum">     522 </span><span class="lineCov">              2 : QString OptManager::pHelp()</span>
<span class="lineNum">     523 </span>                : {
<span class="lineNum">     524 </span><span class="lineCov">              2 :    QString underline(_appName.size(),'=');</span>
<span class="lineNum">     525 </span><span class="lineCov">              2 :    QString desc;</span>
<span class="lineNum">     526 </span><span class="lineCov">              2 :    QString extra;</span>
<span class="lineNum">     527 </span><span class="lineCov">              2 :    QString detail;</span>
<span class="lineNum">     528 </span><span class="lineCov">              2 :    QString arguments;</span>
<span class="lineNum">     529 </span><span class="lineCov">              2 :    desc = &quot;\n&quot;+ _appName + &quot;\n&quot;+ underline + &quot;\nusage: &quot;+ _appName + &quot; [-&quot;;</span>
<span class="lineNum">     530 </span><span class="lineCov">              2 :    if (!_description.isEmpty())</span>
<span class="lineNum">     531 </span>                :    {
<span class="lineNum">     532 </span><span class="lineCov">              2 :       detail += &quot;\n&quot; + _description + &quot;\n&quot;;</span>
<span class="lineNum">     533 </span>                :    }
<span class="lineNum">     534 </span><span class="lineCov">             12 :    for (int i =0; i &lt; _switchList.size(); ++i)</span>
<span class="lineNum">     535 </span>                :    {
<span class="lineNum">     536 </span><span class="lineCov">             10 :       if (_switchList[i]-&gt;finishProcessing())</span>
<span class="lineNum">     537 </span><span class="lineCov">              4 :          extra += &quot;\n       &quot;+ _appName + _switchList[i]-&gt;brief();</span>
<span class="lineNum">     538 </span>                :       else
<span class="lineNum">     539 </span><span class="lineCov">              6 :          if (!_switchList[i]-&gt;abbrev().isNull())</span>
<span class="lineNum">     540 </span><span class="lineCov">              6 :             desc += _switchList[i]-&gt;abbrev();</span>
<span class="lineNum">     541 </span><span class="lineCov">             10 :       detail += &quot;\n   &quot; + _switchList[i]-&gt;help();</span>
<span class="lineNum">     542 </span>                :    }
<span class="lineNum">     543 </span><span class="lineCov">              4 :    for (int i = 0 ; i &lt; _argList.size(); ++i)</span>
<span class="lineNum">     544 </span>                :    {
<span class="lineNum">     545 </span><span class="lineCov">              2 :       arguments += &quot; &quot; + _argList[i]-&gt;help();</span>
<span class="lineNum">     546 </span>                :    }
<span class="lineNum">     547 </span><span class="lineCov">              2 :    return desc + &quot;]&quot; + arguments + extra + detail + &quot;\n\n&quot;;</span>
<span class="lineNum">     548 </span>                : }
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
